import Taro from '@tarojs/taro-rn';
import React from 'react';
import { Component } from "@tarojs/taro-rn";
import { View, Image } from "@tarojs/components-rn";
import { getRuntime } from "../../utils/common";
import upgrade_pay_successStyleSheet from "./upgrade_pay_success_styles";
import success_icon from '../../assets/img/icon_29.png';
var _styleSheet = upgrade_pay_successStyleSheet;
let Success = class Success extends Component {
  constructor(props) {
    super(props);
    this.state = {
      orderInfo: {}
    };
  }
  componentWillMount() {
    Taro.setNavigationBarTitle({ title: '升级成功' });
    let orderInfo = getRuntime().getStorage('orderInfo') || {
      defaultAddress: {},
      orderId: 0,
      orderTotalAmount: 0
    };
    this.setState({
      orderInfo
    });
  }
  handelRouter(url = '/pages/index/index') {
    getRuntime().navigateTo(url);
  }
  render() {
    let { orderInfo } = this.state;
    return <View style={_styleSheet["pay-success"]}>
        <View style={_styleSheet["apply-success"]}>
          <View style={_styleSheet["content"]}>
            <Image src={success_icon} style={_styleSheet["success-icon"]} />
            <View style={_styleSheet["title"]}>支付成功</View>
          </View>

          <View style={_styleSheet["interval"]} />

          <View onClick={this.handelRouter.bind(this, '/pages/user/index')} style={_styleSheet["btn-line-submit"]}>
            返回会员中心
          </View>
        </View>
      </View>;
  }
};

export default Success;